import { defineStore } from 'pinia';
import { ref } from 'vue';
import { appInit } from '@/api';
import { useAppid } from '@/hooks';

export const appInitStore = defineStore('appInit', () => {
  const config = ref<API.AppInit>();
  const appid = useAppid();

  async function getAppInit() {
    const { data } = await appInit(appid);
    config.value = data;
  }

  getAppInit();

  return {
    config,
  };
});
